refactor: dev to main - Improve search index deletion logic and handling#937
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors the Azure Cognitive Search index creation script to ensure a clean index state by deleting any existing index before creating a new one, and by using a dedicated create call rather than update semantics.
Changes:
- Add
ResourceNotFoundErrorhandling to safely ignore “index not found” during deletion. - Delete the existing index (if present) before creating the new index definition.
- Replace
create_or_update_indexwithcreate_indexto enforce fresh index creation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Avijit-Microsoft
approved these changes
Jun 1, 2026
Roopan-Microsoft
approved these changes
Jun 1, 2026
Contributor
|
🎉 This PR is included in version 3.23.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
github-actions Bot
pushed a commit
that referenced
this pull request
Jun 3, 2026
refactor: dev to main - Improve search index deletion logic and handling
github-actions Bot
pushed a commit
that referenced
this pull request
Jun 4, 2026
refactor: dev to main - Improve search index deletion logic and handling
github-actions Bot
pushed a commit
that referenced
this pull request
Jun 4, 2026
refactor: dev to main - Improve search index deletion logic and handling
github-actions Bot
pushed a commit
that referenced
this pull request
Jun 6, 2026
refactor: dev to main - Improve search index deletion logic and handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request updates the
01_create_search_index.pyscript to improve how search indexes are managed during creation. The main changes ensure that any existing index is deleted before a new one is created, and the index creation method is simplified for better reliability.Index management improvements:
INDEX_NAME) before creating a new one, ensuring a clean state and preventing conflicts. If the index does not exist, the script safely ignores the error.ResourceNotFoundErrorfromazure.core.exceptionsto handle cases where the index to be deleted does not exist.Index creation simplification:
create_or_update_indexwithcreate_indexto ensure that a new index is always created after deletion, avoiding accidental updates to an existing index.Does this introduce a breaking change?
Golden Path Validation
Deployment Validation